package com.cx.mapper;

import com.cx.entity.Dept;
import lombok.Data;
import org.apache.ibatis.annotations.*;

import java.util.List;
@Mapper
public interface DeptMapper {
    //查询所有
    @Select("select * from dept")
   List<Dept> selectAllDept();
   //通过ID查询
    @Select("select * from dept where deptID = #{id}")
   Dept selectDeptById(int id);
   //删除一个
    @Delete("delete from dept where deptID = #{id}")
   int deleteDept(int id);
    //新增一个
    @Insert("insert into dept values (#{deptId},#{deptName})")
    int insertDept(Dept dept);
    //修改一个
    @Update("update dept set deptName = #{deptName}")
    int updateDept(Dept dept);
}
